﻿<%@ Page Language="C#" MasterPageFile="~/ClientsMaster.master" AutoEventWireup="true" CodeFile="history.aspx.cs" Inherits="Clients_history" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cph_content" Runat="Server">
<h1>Historie transakcí</h1>
    <asp:Label ID="lbl_ZadnaHistorie" Visible="false" runat="server" Text="Váš účet neobsahuje žádne záznamy o provedených nebo přijatých platbách" />
    <asp:GridView ID="GridView1" DataSourceID="sourcePayment" Width="100%" 
        AutoGenerateColumns="False" runat="server" CellPadding="4" ForeColor="#333333" 
        GridLines="None">
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
    <Columns>
    
   <asp:TemplateField HeaderText="Odesilatel">

                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# DatabaseManager.getPersonByAccont(Eval("FromAccount").ToString()).Email %>' />
                </ItemTemplate>
            </asp:TemplateField>
  <asp:BoundField DataField="amount" HeaderText="Částka" />
    <asp:BoundField DataField="PaidDate" HeaderText="PaidDate" />
    <asp:BoundField DataField="Type" HeaderText="Type" />
    
        <asp:TemplateField HeaderText="Přijemce">

                <ItemTemplate>
                    <asp:Label runat="server" Text='<%# DatabaseManager.getPersonByAccont(Eval("whom").ToString()).Email %>' />
                </ItemTemplate>
            </asp:TemplateField>
            
    <asp:BoundField DataField="Comment" HeaderText="Comment" />
    </Columns>
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <EditRowStyle BackColor="#999999" />
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
    </asp:GridView>

<asp:ObjectDataSource ID="sourcePayment" runat="server" 
        SelectMethod="getPaymentHistoryByPersonId" TypeName="DatabaseManager" DataObjectTypeName="Payment">
       <SelectParameters>
            <asp:Parameter Name="email" Type="String" />
       </SelectParameters>
           
    </asp:ObjectDataSource>
</asp:Content>

